﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

[System.Serializable]
public struct Point{
    public int x;
    public int y;

    public override string ToString()
    {
        return string.Format("[{0}, {1}]", x, y);
    }

    public Point(int i, int j)
    {
        x = i;
        y = j;
    }

    public static  Point operator +(Point p1, Point p2)
    {
        Point p = p1;
        p.x += p2.x;
        p.y += p2.y;
        return p;
    }

    public static Point operator *(Point p, int num)
    {
        Point p1 = p;
        p1.x *= num;
        p1.y *= num;
        return p1;
    }

    public static Point operator *(int num, Point p)
    {
        return p * num;
    }
}
